package com.frxuexi.mdm_2207

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.frxuexi.apps.AppsPage
import com.frxuexi.document.view.DocPage
import com.frxuexi.document.view.LocalDocPage
import com.frxuexi.lib_base.RoutePath
import com.frxuexi.mdm_2207.view.HomePage
import com.frxuexi.mdm_2207.view.MessagePage
import com.frxuexi.mine.view.ApproveLeaveListPage
import com.frxuexi.mine.view.ApproveLeavePage
import com.frxuexi.mine.view.AskLeavePage
import com.frxuexi.mine.view.LeaveDetailPage
import com.frxuexi.mine.view.LeaveListPage
import com.frxuexi.mine.view.LoginPage
import com.frxuexi.mine.view.MinePage
import com.frxuexi.myroom.view.ApproveLeaveListView
import com.frxuexi.myroom.view.ApproveLeaveView
import com.frxuexi.myroom.view.AskLeaveView
import com.frxuexi.myroom.view.LeaveListView
import com.frxuexi.myroom.view.LoginView
import com.frxuexi.mdm_2207.view.MyPage
import com.frxuexi.myroom.view.RegisterView
import com.frxuexi.roport.view.ReportListPage
import com.frxuexi.roport.view.ReportPage
import com.frxuexi.sign.view.SignListPage
import com.frxuexi.sign.view.SignPage

@Composable
fun MyNavHost(it:PaddingValues,navHostController:NavHostController) {
    NavHost(
        modifier = androidx.compose.ui.Modifier.padding(it),
        navController = navHostController,
        startDestination = RoutePath.HOME,
        builder = {
            composable(RoutePath.MESSAGE) { MessagePage() }
            composable(RoutePath.HOME) { HomePage(navHostController) }
            composable(RoutePath.MINE) { MinePage(navHostController) }
//                composable("demo05") { Demo05(navController = navHostController) }
            composable(RoutePath.APPS){ AppsPage(navHostController) }
            composable(RoutePath.DOC){ DocPage(navHostController = navHostController) }
            composable(RoutePath.LOCALDOC){ LocalDocPage(navHostController = navHostController) }
            composable(RoutePath.REPORTLIST){ ReportListPage(navHostController = navHostController) }
            composable(RoutePath.REPORT+"/{report}"){
                val string = it.arguments?.getString("report", "").toString()
                ReportPage(navHostController,string) }
            composable(RoutePath.SIGNLIST){ SignListPage(navHostController = navHostController) }
            composable(RoutePath.SIGN){ SignPage(navHostController = navHostController) }
            composable(RoutePath.LOGIN){ LoginPage(navHostController = navHostController) }
            composable(RoutePath.ASKLEAVE){ AskLeavePage(navHostController = navHostController) }
            composable(RoutePath.LEAVE_LIST){ LeaveListPage(navHostController = navHostController) }
            composable(RoutePath.LEAVE_DETAIL+"/{detail}"){
                val json = it.arguments?.getString("detail", "").toString()
                LeaveDetailPage(navHostController = navHostController,json) }
            composable(RoutePath.APPROVE_LEAVE_LIST){ ApproveLeaveListPage(navHostController = navHostController) }
            composable(RoutePath.APPROVE_LEAVE+"/{detail}"){
                val json = it.arguments?.getString("detail", "").toString()
                ApproveLeavePage(navHostController = navHostController,json) }
            composable(RoutePath.ROOM_REGISTER){ RegisterView(navHostController = navHostController) }
            composable(RoutePath.ROOM_MY){ MyPage(navHostController = navHostController) }
            composable(RoutePath.ROOM_LOGIN){ LoginView(navHostController = navHostController) }
            composable(RoutePath.ROOM_ASKLEAVE){ AskLeaveView(navHostController = navHostController) }
            composable(RoutePath.ROOM_LEAVE_LIST){ LeaveListView(navHostController = navHostController) }
            composable(RoutePath.ROOM_APPROVE_LEAVE_LIST){ ApproveLeaveListView(navHostController = navHostController) }
            composable(RoutePath.ROOM_APPROVE_LEAVE+"/{detail}"){
                val json = it.arguments?.getString("detail", "").toString()
                ApproveLeaveView(navHostController = navHostController,json) }
        })
}